let fs = require("fs");
let {Readable} = require("stream");
let read = new Readable();
let writer = fs.createWriteStream("to.txt");
let reader = fs.createReadStream("from.txt").on("data" , (chunk) => {
    //---------------------------------------------------
    // 使用write写入
    //writer.write(chunk.toString().toUpperCase());

    //---------------------------------------------------
    // 使用管道写入
    read.push(chunk.toString().toUpperCase());
    read.push(null);
    read.pipe(writer);
});
